package com.ziyun.erp.modules.supp.dao;

import com.ziyun.erp.modules.supp.entity.SellerCopyGoodsEntity;
import com.ziyun.erp.modules.supp.entity.SellerInfoEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author gaosheng
 * @email 
 * @date 2018-07-27 11:26:47
 */
public interface SellerInfoDao extends BaseMapper<SellerInfoEntity> {

    int updateMainStore(Map<String, Object> params);

    SellerInfoEntity selectById(@Param("sellerId") Integer sellerId);

    int updateByMap(@Param("map") Map<String, Object> map, @Param("sellerId") Integer sellerId);

    List<SellerInfoEntity> selectByMap(@Param("map") Map<String, Object> map);

    List<Map<String,String>> querySuppliersAuditName();

    int countSellerInfo(@Param("map") Map<String, Object> map);

    List<SellerInfoEntity> queryPageSellerInfoList(@Param("map") Map<String, Object> map);

    List<SellerInfoEntity> queryFactoryList();

    @Select("select a.seller_id as sellerId,a.seller_name as sellerName from seller_info a where a.self = 1 and seller_id not in (1,18,20) ")
    List<SellerInfoEntity> getSelectList();

    Integer selectPopSellerInfo(@Param("sellerId") Integer sellerId);

    List<Map<String,Object>> checkFreeze(Integer sellerId);

    List<SellerInfoEntity> selectThirdOrderSyn();

    @Select("SELECT seller_id,seller_name FROM seller_info WHERE `area`=#{area} AND disabled=0")
    List<Map<String,Object>> getShops(String area);

    List<Long> getNotCopyGoodsSellerIds(@Param("nums") Integer nums);

    @Insert("insert into seller_copy_goods (seller_id, result) values(#{sellerId}, #{result})")
    int saveSellerCopyGoodsInfo(SellerCopyGoodsEntity sellerCopyGoods);
}
